package com.Exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: cp
 * Date: 2023-12-21
 * Time: 10:55
 */
public class TestDemo {
    public static void main(String[] args){
        FileInputStream fin = null;
        try {
            fin = new FileInputStream("C:\\Javacode2\\a.txt");
            int i;
            while((i = fin.read()) != -1){
                System.out.print((char)i +" ");
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }catch(Exception e){
            e.printStackTrace();
        }finally {
            if(fin != null){
                try{
                    fin.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }else{
                fin = null;
            }
        }


    }
}
